<?php

class AdminAction extends BaseAction
{
    protected $enterpriseObj;


    public function __construct()
    {
        parent::__construct();


        $this->access();

        $leftMenus = C('LEFT_MENU_ADMIN');

        $actionName = $this->getControllerFunction();
        $adminObj = session('admin');
        $this->adminObj = $adminObj;

        $alert = parseAlert();

        $this->assign('alert', $alert);

        $this->assign('_actionName', $actionName);
        $this->assign('leftMenus', $leftMenus);
        $this->assign('adminObj', $adminObj);

    }


    protected function access()
    {

        if (!session('?admin')) {
            header("Location:" . $this->baseUrl . "/Admin/Auth/index");
            exit;
        }
    }

}